package test11;

import test11.Day;
import test11.Dog;

public class Test {
    public static void main(String[] args) {
        Day day = new Day(2000, 01, 01);
        Dog hashiqi = new Dog("hashiqi", 2, day);
        System.out.println(hashiqi);//Dog{name = hashiqi, age = 2, day = Day{y = 2000, m = 1, d = 1}}

        day.setY(111);
       // hashiqi.getDay().setY(8888);
        //day.setY(2011);//我这里修改的是day,但是我打印的hashiqi的值也修改了
        //我都没有修改hashiqi的值,
        System.out.println(hashiqi);
        //一个是浅度复制,一个是深度复制
        //浅度就是:把地址值传过去就行了
        //深度就是:重新创建一个对象,这个对象的值和传递过来的对象一样,但是地址值不一样
    }
}
